<!--  -->
<template>
  <div class>
    <section class="app-main">
      <section class="container-main-header">
        <section class="header-left">
          <i class="el-icon-menu"></i>
          <h3>首页</h3>
          <span class="solidus">/</span>
          <h3>营销</h3>
          <span class="solidus">/</span>
          <span>优惠券列表</span>
        </section>
        <section class="header-right">
          <i class="el-icon-pear" @click="leaveHandle"></i>
        </section>
      </section>
      <div class="miaosha-box">
        <div class="search-Box">
          <div class="search-box">
            <div>
              <i class="el-icon-search"></i>&nbsp;&nbsp;
              <span>筛选搜索 (优惠)</span>
              <el-button type="primary" style="float: right; ">查询搜索</el-button>
              <el-button style="float: right;margin-right:15px;">重置</el-button>
            </div>
            <div class="miaosha-input">
              <span>活动名称：</span>
              <el-input placeholder="请输入内容" v-model="input" clearable style="width:200px"></el-input>
              <span>优惠券类型：</span>
              <el-select v-model="value" clearable placeholder="请选择">
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </div>
          </div>
        </div>
        <div class="datalist" style="margin-top:20px;">
          <div class="datalist-box">
            <i class="el-icon-document"></i>&nbsp;&nbsp;
            <span>数据列表</span>
            <el-button class="addactivity" style="float: right;padding:6px 14px">添加</el-button>
          </div>
        </div>
        <div class="table-container">
          <div class="datalist-content">
            <table class="tablee" cellspacing="0" cellpadding="0">
              <tr class="hang">
                <td style="width:60px" class="confirm-box">
                  <input type="checkbox" class="confirm" />
                </td>
                <td style="width:120px">编号</td>
                <td style="width:175px">优惠券名称</td>
                <td style="width:120px">优惠券类型</td>
                <td style="width:120px">可使用商品</td>
                <td style="width:175px">使用门槛</td>
                <td style="width:120px">面值</td>
                <td style="width:120px">适用平台</td>
                <td style="width:225px">有效期</td>
                <td style="width:120px">状态</td>
                <td style=" border-right: 1px solid #ececec;">操作</td>
              </tr>
              <!-- 遍历数据 -->
              <tr class="hanglist">
                <td style="width:60px">
                  <input type="checkbox" class="confirm" />
                </td>
                <td style="width:120px">2</td>
                <td style="width:175px">全品类通用券</td>
                <td style="width:120px">全场赠券</td>
                <td style="width:120px">全场通用</td>
                <td style="width:175px">满100元可用</td>
                <td style="width:120px">10元</td>
                <td style="width:120px">全平台</td>
                <td style="width:225px">2018-08-27至2018-11-23</td>
                <td style="width:120px">已过期</td>
                <td style="width:180px; border-right: 1px solid #ececec;" class="operation">
                  <button>查看</button>
                  <button>编辑</button>
                  <button>删除</button>
                </td>
              </tr>
            </table>
          </div>
        </div>
        <el-pagination
          @size-change="handleSizeChange"
          background
          @current-change="handleCurrentChange"
          :current-page="currentPage4"
          :page-sizes="[5, 10, 15,]"
          :page-size="5"
          layout="total, sizes, prev, pager, next, jumper"
          :total="10"
          style="float:right;margin-top:20px;"
        ></el-pagination>
      </div>
    </section>
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';

export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  data() {
    //这里存放数据
    return {
      input: "",
      kaiguan: true,
      currentPage4: 4,
      options: [
        {
          value: "选项1",
          label: "全场赠券",
        },
        {
          value: "选项2",
          label: "全员赠券",
        },
        {
          value: "选项3",
          label: "购物赠券",
        },
        {
          value: "选项4",
          label: "注册赠券",
        },
      ],
      value: "",
    };
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
    leaveHandle() {
      var n = confirm("是否退出登录");
      if (n == true) {
        window.sessionStorage.clear();
        location.reload();
      }
    },
  },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style scoped>
.container-main-header {
  padding: 0 20px;
  align-items: center;
  width: 100%;
  height: 50px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #ccc;
}
.header-left {
  display: flex;
  align-items: center;
}
.header-left h3 {
  font-size: 14px;
}
.solidus {
  margin: 0 5px;
}
.el-icon-menu {
  margin-right: 20px;
  font-size: 20px;
  cursor: pointer;
}
.el-icon-pear {
  font-size: 24px;
  cursor: pointer;
}
.app-main {
  min-height: 100%;
}
.miaosha-box {
  padding: 20px;
}
.app-main .miaosha-box .search-Box,
.datalist {
  border: 1px solid #ebeef5;
  background-color: #fff;
  color: #303133;
  border-radius: 4px;
}
.app-main .miaosha-box .search-Box .search-box,
.datalist-box {
  padding: 20px;
}
.app-main .miaosha-box .miaosha-input {
  /* width: 380px; */
  height: 32px;
  display: flex;
  align-items: center;
  font-size: 12px;
  margin-top: 30px;
}
.app-main .miaosha-box .miaosha-input span {
  /* width: 130px; */
  margin-left: 60px;
  font-size: 16px;
}
.addactivity span {
  width: 82px;
  height: 12px;
  line-height: 12px;
  font-size: 12px;
}
.datalist-content {
  /* width: 1127px; */
  min-height: 48px;
  margin-top: 20px;
}
.hang {
  height: 48px;
}

.tablee > tr > td {
  border: 1px solid #ececec;
  text-align: center;
  line-height: 48px;
  border-right: none;
}
.table-container .tablee  .confirm{
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-top: 14px;
    /* outline: none;
    border: none; */
}
.operation {
  font-size: 13px;
}
.operation > button {
  border: none;
  outline: none;
  margin: 0 5px;
  background: #fff;
  color: #66b1ff;
}
</style>